<!--
 * @Author: your name
 * @Date: 2021-03-31 22:21:24
 * @LastEditTime: 2021-03-31 22:34:30
 * @LastEditors: Please set LastEditors
 * @Description: 语法
 * @FilePath: \jQuery\01 - 语法.html
-->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>语法</title>
  <script src="./jquery-3.6.0.min.js"></script>
  <script>
    // 鼠标悬浮在123上面，内容变成abc
    // $(document).ready(function() {
    //   $('.box').hover(function() {
    //     console.log(1111);
    //     $('.box').html('abc')
    //   })
    // })
    // ready函数可以简写,以下效果与上面一致
    $(function() {
      $('.box').hover(function() {
        console.log(1111);
        $('.box').html('abc')
      })
    })
  </script>
</head>
<body>
  <div class="box">123</div>
</body>
</html>